const keepAlive = {
  state: {
    keepAliveNames: [],
    noKeepAliveNames: []
  },
  mutations: {
    ADD_KEEP_ALIVE: (state, componentName) => {
      if (state.keepAliveNames.some(v => v === componentName)) return
      state.keepAliveNames.push(componentName)
    },
    ADD_NO_KEEP_ALIVE: (state, componentName) => {
      if (state.noKeepAliveNames.some(v => v === componentName)) return
      state.noKeepAliveNames.push(componentName)
    }
  }
}
export default keepAlive
